= simple_form_for(@post, html: { class: 'form-horizontal' }) do |f|
  = f.input :plate_id, as: :hidden
  %table.table.table-condensed.table-striped{style: "text-align: center;vertical-align:middle"}
    %tr
      %td 标题
      %td
        = f.input_field :title, class: 'form-control'
        = f.error :title
    %tr
      %td{width: '5%'} 内容
      %td
        = f.input_field :content, as: :text
        = f.error :content
    %tr
      %td 封面图
      %td= f.input_field :cover_src, as: :file
    %tr
      %td 附件
      %td= f.input_field :file_name, as: :file
    %tr
      %td{colspan: 2}
        .pull-right
          = link_to '取消', posts_path(plate_id: @post.plate_id), class: 'btn btn-default'
          = f.submit '保存', class: 'btn btn-primary'


:javascript
  $(document).ready(function(){
    $('form[data-remote]').bind('ajax:before', function(){
      for (instance in CKEDITOR.instances){
        CKEDITOR.instances[instance].updateElement();
      }
    });
    CKEDITOR.replace('post_content', {height: 800});
  });